import api from './axios';
// 数据库管理
// 查询全部
export const selectDataBase = (data: {}) => api({ url: '/selectDataBase', method: 'post', data });
// 条件查询
export const selectByDataBase = (data: { baseStatus: number; baseName: string; pageSize: string; pageNum: string }) => api({ url: '/selectByDataBase', method: 'post', data });
// 编辑中根据ID查询信息
export const selectBaseId = (data: { baseId: number }) => api({ url: '/selectBaseId', method: 'post', data });
// 编辑根据baseid修改数据源信息
export const updateDatabase = (data: { baseName: string; baseType: string; baseMsg: string; baseUrls: string; baseDriver: string; baseUser: string; basePsw: string; baseId: number }) =>
  api({ url: '/updateDatabase', method: 'post', data });
// 修改发布状态
export const updateDaseStatus = (data: { baseId: number; baseStatus: string }) => api({ url: '/updateDaseStatus', method: 'post', data });
// 新增数据源
export const addDatabase = (data: { baseName: string; baseType: string; baseUrls: string; baseDriver: string; baseMsg: string; baseUser: string; basePsw: string }) =>
  api({ url: '/addDatabase', method: 'post', data });
// 数据库逻辑删除
export const tombstone = (data: { baseId: number }) => api({ url: '/tombstone', method: 'delete', data });
